package nl.saxion.ein4b.model;

import java.io.Serializable;

/**
 * Profile to keep track of score
 * 
 * @author Harm
 * 
 */
public class Profile implements Serializable, Comparable {

	private String name, picture;
	private int credit, numGamesPlayed, profileNumber;

	public void setNumGamesPlayed(int numGamesPlayed) {
		this.numGamesPlayed = numGamesPlayed;
	}

	/**
	 * @param name
	 * @param picture
	 * @param credit
	 * @param numGamesPlayed
	 */
	public Profile(String name, String picture, int credit, int numGamesPlayed) {
		super();
		this.name = name;
		this.picture = picture;
		this.setCredit(credit);
		this.numGamesPlayed = numGamesPlayed;
	}

	public Profile(String name, String picture, int credit, int numGamesPlayed,
			int profileNumber) {
		super();
		this.name = name;
		this.picture = picture;
		this.setCredit(credit);
		this.numGamesPlayed = numGamesPlayed;
		this.profileNumber = profileNumber;
	}

	public int getProfileNumber() {
		return profileNumber;
	}

	public void setProfileNumber(int profileNumber) {
		this.profileNumber = profileNumber;
	}

	public String getName() {
		return name;
	}

	public void setCredit(int credit) {
		this.credit = credit;
	}

	public String getPicture() {
		return picture;
	}

	public int getCredit() {
		return credit;
	}

	public int getNumGamesPlayed() {
		return numGamesPlayed;
	}

	public String toString() {
		return "Naam: " + name + " Credit: " + credit + " Games Played: "
				+ numGamesPlayed;

	}

	public int compareTo(Object o1) {
		if (this.credit == ((Profile) o1).credit)
			return 0;
		else if ((this.credit) < ((Profile) o1).credit)
			return 1;
		else
			return -1;
	}

}
